<template>
  <div>
    <img src="../assets/2.png" />
    <NewsList :data="newsList"></NewsList>
  </div>
</template>

<script setup>
import { ref } from "vue";
import NewsList from "../components/NewsList";
import axios from "axios";

const newsList = ref([]);

axios
  .get("/juheNews?type=top&key=dfdf150a605d1a7b5cbe6e03fb52771e")
  .then((response) => {
    newsList.value = response.data.result.data;
  })
  .catch((error) => {
    console.log(error);
  });
</script>

<style scoped>
img {
  width: 100%;
  height: 200px;
  display: block;
}
</style>